/**
 */
package gatperdut.chato.model.Chato.Item.impl;

import gatperdut.chato.model.Chato.Item.BoxInventory;
import gatperdut.chato.model.Chato.Item.Item;
import gatperdut.chato.model.Chato.Item.ItemPackage;
import gatperdut.chato.model.Chato.Item.ItemTemplate;

import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Item</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link gatperdut.chato.model.Chato.Item.impl.ItemImpl#getTemplate <em>Template</em>}</li>
 *   <li>{@link gatperdut.chato.model.Chato.Item.impl.ItemImpl#getInventory <em>Inventory</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class ItemImpl extends GenericItemImpl implements Item {
	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	protected ItemImpl() {
        super();
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	@Override
	protected EClass eStaticClass() {
        return ItemPackage.Literals.ITEM;
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	public ItemTemplate getTemplate() {
        return (ItemTemplate)eDynamicGet(ItemPackage.ITEM__TEMPLATE, ItemPackage.Literals.ITEM__TEMPLATE, true, true);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	public ItemTemplate basicGetTemplate() {
        return (ItemTemplate)eDynamicGet(ItemPackage.ITEM__TEMPLATE, ItemPackage.Literals.ITEM__TEMPLATE, false, true);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	public void setTemplate(ItemTemplate newTemplate) {
        eDynamicSet(ItemPackage.ITEM__TEMPLATE, ItemPackage.Literals.ITEM__TEMPLATE, newTemplate);
    }

	/**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public BoxInventory getInventory() {
        return (BoxInventory)eDynamicGet(ItemPackage.ITEM__INVENTORY, ItemPackage.Literals.ITEM__INVENTORY, true, true);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public NotificationChain basicSetInventory(BoxInventory newInventory, NotificationChain msgs) {
        msgs = eDynamicInverseAdd((InternalEObject)newInventory, ItemPackage.ITEM__INVENTORY, msgs);
        return msgs;
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setInventory(BoxInventory newInventory) {
        eDynamicSet(ItemPackage.ITEM__INVENTORY, ItemPackage.Literals.ITEM__INVENTORY, newInventory);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
        switch (featureID) {
            case ItemPackage.ITEM__INVENTORY:
                return basicSetInventory(null, msgs);
        }
        return super.eInverseRemove(otherEnd, featureID, msgs);
    }

    /**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
        switch (featureID) {
            case ItemPackage.ITEM__TEMPLATE:
                if (resolve) return getTemplate();
                return basicGetTemplate();
            case ItemPackage.ITEM__INVENTORY:
                return getInventory();
        }
        return super.eGet(featureID, resolve, coreType);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	@Override
	public void eSet(int featureID, Object newValue) {
        switch (featureID) {
            case ItemPackage.ITEM__TEMPLATE:
                setTemplate((ItemTemplate)newValue);
                return;
            case ItemPackage.ITEM__INVENTORY:
                setInventory((BoxInventory)newValue);
                return;
        }
        super.eSet(featureID, newValue);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	@Override
	public void eUnset(int featureID) {
        switch (featureID) {
            case ItemPackage.ITEM__TEMPLATE:
                setTemplate((ItemTemplate)null);
                return;
            case ItemPackage.ITEM__INVENTORY:
                setInventory((BoxInventory)null);
                return;
        }
        super.eUnset(featureID);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	@Override
	public boolean eIsSet(int featureID) {
        switch (featureID) {
            case ItemPackage.ITEM__TEMPLATE:
                return basicGetTemplate() != null;
            case ItemPackage.ITEM__INVENTORY:
                return getInventory() != null;
        }
        return super.eIsSet(featureID);
    }

} //ItemImpl
